<p>
<?php
if ($this->authenticated) {
    ?>
    You are already authenticated, <?php echo $this->escape($this->username) ?>.
    </p>
    <p>
    <?php
} else {
    if (isset($this->messages)) {
        ?>
        The following problems were encountered with your last login attempt:
        </p>
        <p>
        <?php
        foreach ($this->messages as $field => $messages) {
            ?>
            <b><?php echo $this->escape($field) ?></b><br />
            <?php
            foreach ($messages as $message) {
                echo $this->escape($message) . "<br />\n";
            }
            ?>
            </p>
            <p>
            <?php
        }
    }
    ?>
<form action="<?php echo $this->baseUrl ?>/user/login" method="POST">
<table cellpadding="2" cellspacing="2">
	<tr>
		<td align="right">Username</td>
		<td><input name="username" type="text" value="<?php echo $this->escape($this->username) ?>" /></td>
	</tr>
	<tr>
		<td align="right">Password</td>
		<td><input name="password" type="password" /></td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td><input type="submit" value="Login" /></td>
	</tr>
</form>
    <?php
}
?>
</p>